{{include template('public/header','admin')}}
<title>支付宝支付配置</title>
</head>
<body>
    <div class="container">
        <div style="margin: 20px;">
            <form class="form-horizontal" role="form"  method="post"  id="cpform" name="cpform"  onsubmit="return dosub(this)" >
                <input type='hidden' name='id' value="{{$id}}" />
                <div class="form-group">
                    <label for="name" class="col-sm-2 control-label">支付方式</label>
                    <div class="col-sm-10">
                        支付宝
                    </div>
                </div>
                <div class="form-group">
                    <label for="tablename" class="col-sm-2 control-label">签名方式</label>
                    <div class="col-sm-10">
                        RSA2
                    </div>
                </div>
                <div class="form-group">
                    <label for="description" class="col-sm-2 control-label">应用ID(APPID)</label>
                    <div class="col-sm-10">
                        <input type="text" class="form-control" id="config[app_id]" name="config[app_id]" value="{{$item['app_id']}}" />
                    </div>
                </div>
                <div class="form-group">
                    <label for="description" class="col-sm-2 control-label">商户应用私钥</label>
                    <div class="col-sm-10">
                        <textarea id="config[merchant_private_key]" name="config[merchant_private_key]" class="form-control">{{$item['merchant_private_key']}}</textarea>
                    </div>
                </div>

                <div class="form-group">
                    <label for="description" class="col-sm-2 control-label">支付宝公钥</label>
                    <div class="col-sm-10">
                        <textarea id="config[alipay_public_key]" name="config[alipay_public_key]" class="form-control">{{$item['alipay_public_key']}}</textarea>

                    </div>
                </div>
                <div class="form-group">
                    <label for="enabled" class="col-sm-2 control-label">状态</label>
                    <div class="col-sm-10">
                        <label class="radio-inline">
                            <input type="radio" name="enabled" value="1"  {{if $item.enabled eq '1'}}checked{{/if}}> 是
                        </label>
                        <label class="radio-inline">
                            <input type="radio" name="enabled" value="0"  {{if $item.enabled eq '0'}}checked{{/if}}> 否
                        </label>
                    </div>
                </div>

                <div class="form-group">
                    <div class="col-sm-offset-2 col-sm-10">
                        <input type="submit" name="dosubmit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;" class="btn btn-primary "/>
                    </div>
                </div>
            </form>
        </div>
    </div>

    <script type="text/javascript">
        function dosub(obj) {
            $.ajax({
                type: 'POST',
                url: '/pay/pay/edit',
                data: $(obj).serialize(),
                dataType: "json",
                success: function (ret) {
                    if (ret.status == "y") {
                        parent.location.reload();
                    } else {
                        layer.msg(ret.info);
                    }
                }
            });
            return false;
        }
    </script>
</body>
</html>